export type Maybe<T> = T | null
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
  ID: string
  String: string
  Boolean: boolean
  Int: number
  Float: number
  TimeDuration: any
  GridType: any
}

export type AuthPayload = {
  __typename?: 'AuthPayload'
  token: Scalars['String']
  player: Player
}

export type CharacterData = {
  __typename?: 'CharacterData'
  id: Scalars['ID']
  imgUrl: Scalars['String']
}

export enum Difficulty {
  Easy = 'EASY',
  Medium = 'MEDIUM',
  Hard = 'HARD',
  VeryHard = 'VERY_HARD'
}

export enum GameMode {
  Coor = 'COOR',
  Versus = 'VERSUS'
}

export type ListUpdatedResRoom = Room | Node

export type Mutation = {
  __typename?: 'Mutation'
  login: AuthPayload
  logout: Scalars['Boolean']
  register: RegisterPayload
  createRoom: Room
  setRoomSetting: Room
  joinRoom: Room
  leaveRoom: Scalars['Boolean']
  startGame: Scalars['Boolean']
  pushAnswer: SudokuAnswerRes
  toggleReadyOrWait?: Maybe<Scalars['Boolean']>
}

export type MutationLoginArgs = {
  playerToken: Scalars['String']
}

export type MutationRegisterArgs = {
  input: RegisterInput
}

export type MutationSetRoomSettingArgs = {
  roomId: Scalars['ID']
  setting: RoomSettingInput
}

export type MutationJoinRoomArgs = {
  roomId: Scalars['ID']
}

export type MutationPushAnswerArgs = {
  answer: Scalars['GridType']
}

export type MutationToggleReadyOrWaitArgs = {
  ready: Scalars['Boolean']
}

export type Node = {
  __typename?: 'Node'
  id: Scalars['ID']
}

export type Player = {
  __typename?: 'Player'
  id: Scalars['ID']
  token: Scalars['String']
  name: Scalars['String']
  rank: Rank
  score: Scalars['Int']
  character: CharacterData
  state: PlayerState
}

export type PlayerLocation = {
  __typename?: 'PlayerLocation'
  roomID: Scalars['ID']
  seat: Scalars['Int']
}

export type PlayerState = {
  __typename?: 'PlayerState'
  playerID: Scalars['ID']
  status: Status
  progress: Scalars['Float']
  playingPuzzleID: Scalars['ID']
  gamingScore: Scalars['Int']
  location: PlayerLocation
}

export type PropheticError = {
  __typename?: 'PropheticError'
  name: Scalars['String']
  message: Scalars['String']
  extensions: PropheticErrorExtensions
}

export type PropheticErrorExtensions = {
  __typename?: 'PropheticErrorExtensions'
  code: Scalars['String']
}

export type Puzzle = {
  __typename?: 'Puzzle'
  id: Scalars['ID']
  content: Scalars['String']
  difficulty: Difficulty
  playerPlayed: Scalars['Int']
  highestScore: Scalars['Int']
  shortestTime: Scalars['TimeDuration']
}

export type Query = {
  __typename?: 'Query'
  errors: Array<PropheticError>
  player: Player
  room: Room
  rooms: Array<Room>
}

export type QueryPlayerArgs = {
  playerId: Scalars['ID']
}

export type QueryRoomArgs = {
  id: Scalars['ID']
}

export enum Rank {
  Gold = 'GOLD',
  Siver = 'SIVER',
  Bronze = 'BRONZE'
}

export type RegisterInput = {
  playerName: Scalars['String']
  characterImageUrl: Scalars['String']
}

export type RegisterPayload = {
  __typename?: 'RegisterPayload'
  token: Scalars['String']
  player: Player
  loginToken: Scalars['String']
}

export type Room = {
  __typename?: 'Room'
  id: Scalars['ID']
  host: Player
  players: Array<Player>
  setting: RoomSetting
  puzzle: Puzzle
  remainTime: Scalars['TimeDuration']
  status: RoomStatus
}

export enum RoomListUpdatedKind {
  Added = 'ADDED',
  Deleted = 'DELETED',
  Updated = 'UPDATED'
}

export type RoomListUpdatedRes = {
  __typename?: 'RoomListUpdatedRes'
  room: ListUpdatedResRoom
  kind: RoomListUpdatedKind
}

export type RoomSetting = {
  __typename?: 'RoomSetting'
  mode: GameMode
  maxPlayer: Scalars['Int']
  duration: Scalars['TimeDuration']
  difficulty: Difficulty
}

export type RoomSettingInput = {
  mode: GameMode
  difficulty: Difficulty
  maxPlayer: Scalars['Int']
  duration: Scalars['TimeDuration']
}

export enum RoomStatus {
  Waiting = 'WAITING',
  Gaming = 'GAMING'
}

export enum Status {
  Offline = 'OFFLINE',
  Wandering = 'WANDERING',
  Waiting = 'WAITING',
  Ready = 'READY',
  Gaming = 'GAMING'
}

export type Subscription = {
  __typename?: 'Subscription'
  roomSettingChanged: RoomSetting
  playerJoined: Player
  playerLeft: Player
  gameStarted: Room
  roomStateChanged: Room
  gameTimeSync: Scalars['TimeDuration']
  playerStatesUpdated: PlayerState
  roomListUpdated: RoomListUpdatedRes
}

export type SudokuAnswerRes = {
  __typename?: 'SudokuAnswerRes'
  score?: Maybe<Scalars['Int']>
  conflictElem?: Maybe<Scalars['GridType']>
  validElem?: Maybe<Scalars['GridType']>
}

export type RoomSettingMutationVariables = {
  id: Scalars['ID']
  input: RoomSettingInput
}

export type RoomSettingMutation = { __typename?: 'Mutation' } & {
  setRoomSetting: { __typename?: 'Room' } & Pick<Room, 'id'>
}

export type CreateRoomMutationVariables = {}

export type CreateRoomMutation = { __typename?: 'Mutation' } & {
  createRoom: { __typename?: 'Room' } & Pick<Room, 'id'>
}

export type JoinRoomMutationVariables = {
  roomID: Scalars['ID']
}

export type JoinRoomMutation = { __typename?: 'Mutation' } & {
  joinRoom: { __typename?: 'Room' } & Pick<Room, 'id'>
}

export type LeaveRoomMutationVariables = {}

export type LeaveRoomMutation = { __typename?: 'Mutation' } & Pick<
  Mutation,
  'leaveRoom'
>

export type LoginMutationVariables = {
  loginToken: Scalars['String']
}

export type LoginMutation = { __typename?: 'Mutation' } & {
  login: { __typename?: 'AuthPayload' } & Pick<AuthPayload, 'token'> & {
      player: { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
          character: { __typename?: 'CharacterData' } & Pick<
            CharacterData,
            'imgUrl'
          >
        }
    }
}

export type LogoutMutationVariables = {}

export type LogoutMutation = { __typename?: 'Mutation' } & Pick<
  Mutation,
  'logout'
>

export type PlayerQueryVariables = {
  playerID: Scalars['ID']
}

export type PlayerQuery = { __typename?: 'Query' } & {
  player: { __typename?: 'Player' } & Pick<Player, 'token'>
}

export type PlayerStateUpdatedSubscriptionVariables = {}

export type PlayerStateUpdatedSubscription = { __typename?: 'Subscription' } & {
  playerStatesUpdated: { __typename?: 'PlayerState' } & Pick<
    PlayerState,
    'playerID' | 'status' | 'progress' | 'gamingScore'
  > & {
      location: { __typename?: 'PlayerLocation' } & Pick<PlayerLocation, 'seat'>
    }
}

export type PushAnswerMutationVariables = {
  answer: Scalars['GridType']
}

export type PushAnswerMutation = { __typename?: 'Mutation' } & {
  pushAnswer: { __typename?: 'SudokuAnswerRes' } & Pick<
    SudokuAnswerRes,
    'conflictElem' | 'validElem'
  >
}

export type RegisterMutationVariables = {
  input: RegisterInput
}

export type RegisterMutation = { __typename?: 'Mutation' } & {
  register: { __typename?: 'RegisterPayload' } & Pick<
    RegisterPayload,
    'token' | 'loginToken'
  > & {
      player: { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
          character: { __typename?: 'CharacterData' } & Pick<
            CharacterData,
            'imgUrl'
          >
        }
    }
}

export type RoomStateChangedSubscriptionVariables = {}

export type RoomStateChangedSubscription = { __typename?: 'Subscription' } & {
  roomStateChanged: { __typename?: 'Room' } & Pick<Room, 'id' | 'status'> & {
      host: { __typename?: 'Player' } & Pick<Player, 'id'>
      players: Array<
        { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
            character: { __typename?: 'CharacterData' } & Pick<
              CharacterData,
              'imgUrl'
            >
            state: { __typename?: 'PlayerState' } & Pick<
              PlayerState,
              'playerID' | 'status' | 'progress' | 'gamingScore'
            > & {
                location: { __typename?: 'PlayerLocation' } & Pick<
                  PlayerLocation,
                  'seat'
                >
              }
          }
      >
      puzzle: { __typename?: 'Puzzle' } & Pick<
        Puzzle,
        'id' | 'content' | 'playerPlayed' | 'highestScore'
      >
      setting: { __typename?: 'RoomSetting' } & Pick<
        RoomSetting,
        'mode' | 'maxPlayer' | 'difficulty'
      >
    }
}

export type RoomsQueryVariables = {}

export type RoomsQuery = { __typename?: 'Query' } & {
  rooms: Array<
    { __typename?: 'Room' } & Pick<Room, 'id' | 'status'> & {
        host: { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
            character: { __typename?: 'CharacterData' } & Pick<
              CharacterData,
              'imgUrl'
            >
          }
        setting: { __typename?: 'RoomSetting' } & Pick<
          RoomSetting,
          'mode' | 'maxPlayer' | 'difficulty'
        >
        players: Array<{ __typename?: 'Player' } & Pick<Player, 'id'>>
      }
  >
}

export type RoomQueryVariables = {
  id: Scalars['ID']
}

export type RoomQuery = { __typename?: 'Query' } & {
  room: { __typename?: 'Room' } & Pick<Room, 'id' | 'status'> & {
      host: { __typename?: 'Player' } & Pick<Player, 'id'>
      players: Array<
        { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
            character: { __typename?: 'CharacterData' } & Pick<
              CharacterData,
              'imgUrl'
            >
            state: { __typename?: 'PlayerState' } & Pick<
              PlayerState,
              'playerID' | 'status' | 'progress' | 'gamingScore'
            > & {
                location: { __typename?: 'PlayerLocation' } & Pick<
                  PlayerLocation,
                  'seat'
                >
              }
          }
      >
      puzzle: { __typename?: 'Puzzle' } & Pick<
        Puzzle,
        'id' | 'content' | 'playerPlayed' | 'highestScore'
      >
      setting: { __typename?: 'RoomSetting' } & Pick<
        RoomSetting,
        'mode' | 'maxPlayer' | 'difficulty'
      >
    }
}

export type StartGameMutationVariables = {}

export type StartGameMutation = { __typename?: 'Mutation' } & Pick<
  Mutation,
  'startGame'
>

export type RoomListSubscriptionVariables = {}

export type RoomListSubscription = { __typename?: 'Subscription' } & {
  roomListUpdated: { __typename?: 'RoomListUpdatedRes' } & Pick<
    RoomListUpdatedRes,
    'kind'
  > & {
      room:
        | ({ __typename: 'Room' } & Pick<Room, 'id' | 'status'> & {
              host: { __typename?: 'Player' } & Pick<Player, 'id' | 'name'> & {
                  character: { __typename?: 'CharacterData' } & Pick<
                    CharacterData,
                    'imgUrl'
                  >
                }
              players: Array<{ __typename?: 'Player' } & Pick<Player, 'id'>>
              setting: { __typename?: 'RoomSetting' } & Pick<
                RoomSetting,
                'difficulty' | 'mode' | 'maxPlayer'
              >
            })
        | ({ __typename: 'Node' } & Pick<Node, 'id'>)
    }
}

export type ToggleReadyMutationVariables = {
  ready: Scalars['Boolean']
}

export type ToggleReadyMutation = { __typename?: 'Mutation' } & Pick<
  Mutation,
  'toggleReadyOrWait'
>
